<%@ include file="/WEB-INF/views/includes.jsp"%>
<%@ page session="false"%>
<%@ page isELIgnored="false"%>
<html>
<head>
<title>Home</title>

<link rel="stylesheet" type="text/css" href="/resource/css/default.css" />
<script type="text/javascript" src="/resource/js/jquery-1.8.min.js"></script>

<script type="text/javascript">
	$(document).ready(function() {
		$("#addNewCategoryButton").click(function() {
			document.location.href = '/category/addNewCategory_Form.do';
		});
	});
</script>


<style>
</style>

</head>
<body>

	<caption>Category List:</caption>
	<input id="addNewCategoryButton" type="button" value="Add" />
	<input type="button" onclick="" value="Delete" />
	<table class="dataTable">
		<tr>
			<th scope="col">category_id</th>
			<th scope="col">category_name</th>
			<th scope="col">domain_id</th>
			<th scope="col">parent_category_id</th>
		</tr>
		<c:forEach var="category" items="${categoryList.pageList}">
			<tr>
				<th scope="row" class="spec"><c:out
						value="${category.category_id}"></c:out>
				</th>
				<td><a href=""><c:out value="${category.category_name}">
				</a> </c:out>
				</td>
				<td><c:out value="${category.domain_id}"></c:out>
				</td>
				<td><c:out value="${category.parent_category_id}"></c:out>
				</td>
			</tr>
		</c:forEach>
		<tr>
			<td colspan="100%" align="right">totle records: <font color=red>${categoryList.nrOfElements}</font>,
				totle pages: <font color=red>${categoryList.pageCount}</font>,
				current pages: <font color=red>${categoryList.page+1}</font>&nbsp;&nbsp;

				<c:choose>
					<c:when test="${!categoryList.firstPage}">
						<a class="pagination_footer_A"
							href="/category/listAll.do?pageType=previous&flag=false"><span>prev</span>
						</a>
					</c:when>
					<c:otherwise>
						<a class="pagination_footer_A" href=#><span>prev</span> </a>
					</c:otherwise>
				</c:choose> &nbsp; <c:choose>
					<c:when test="${!categoryList.lastPage}">
						<a class="pagination_footer_A"
							href="/category/listAll.do?pageType=next&flag=false"><span>next</span>
						</a>
					</c:when>
					<c:otherwise>
						<a class="pagination_footer_A" href=#><span>next </span>
						</a>
					</c:otherwise>
				</c:choose>
			</td>
		<tr>
	</table>

	<table>

	</table>

</body>
</html>
